# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Mario Blättermann <mario.blaettermann@gmail.com>
# Contributor: Benjamin Vialle <archlinux@vialle.io>
# Contributor: Rafael Fontenelle <rafaelff@gnome.org>

pkgbase=man-pages-l10n
pkgname=('man-pages-cs'
         'man-pages-da'
         'man-pages-de'
         'man-pages-el'
         'man-pages-es'
         'man-pages-fi'
         'man-pages-fr'
         'man-pages-hu'
         'man-pages-id'
         'man-pages-it'
         'man-pages-mk'
         'man-pages-nb'
         'man-pages-nl'
         'man-pages-pl'
         'man-pages-pt_br'
         'man-pages-ro'
         'man-pages-ru'
         'man-pages-sv'
         'man-pages-sr'
         'man-pages-uk'
         'man-pages-vi')
pkgver=4.20.0
pkgrel=1
pkgdesc="Translation of man pages"
arch=('any')
url="https://salsa.debian.org/manpages-l10n-team/manpages-l10n"
license=('GPL3')
depends=('man')
makedepends=('po4a')
changelog=$pkgbase.changelog
options=('!emptydirs')
source=("$url/-/archive/$pkgver/manpages-l10n-$pkgver.tar.bz2")
sha256sums=('2caa7efbdeb5d5c97f38ca45dc53287d9a875feedc5d2f114047c406cd06cd4d')

build() {
  cd manpages-l10n-$pkgver
  ./configure --prefix=/usr --enable-distribution=archlinux --enable-compression=none

  for _lang in cs da de el es fi fr hu id it mk nb nl pl pt_BR ro ru sr sv uk vi; do
    make -C po/"${_lang}"
  done
}

check() {
  cd manpages-l10n-$pkgver

  for _lang in cs da de el es fi fr hu id it mk nb nl pl pt_BR ro ru sr sv uk vi; do
    make check -k -C po/"${_lang}"
  done
}

package_man-pages-cs() {
  pkgdesc="Czech man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/cs
  make DESTDIR="${pkgdir}" install
}

package_man-pages-da() {
  pkgdesc="Danish man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/da
  make DESTDIR="${pkgdir}" install
}

package_man-pages-de() {
  pkgdesc="German man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/de
  make DESTDIR="${pkgdir}" install
}

package_man-pages-el() {
  pkgdesc="Greek man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/el
  make DESTDIR="${pkgdir}" install
}

package_man-pages-es() {
  pkgdesc="Spanish man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/es
  make DESTDIR="${pkgdir}" install
}

package_man-pages-fi() {
  pkgdesc="Finnish man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/fi
  make DESTDIR="${pkgdir}" install
}

package_man-pages-fr() {
  pkgdesc="French man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/fr
  make DESTDIR="${pkgdir}" install
}

package_man-pages-hu() {
  pkgdesc="Hungarian man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/hu
  make DESTDIR="${pkgdir}" install
}

package_man-pages-id() {
  pkgdesc="Indonesian man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/id
  make DESTDIR="${pkgdir}" install
}

package_man-pages-it() {
  pkgdesc="Italian man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/it
  make DESTDIR="${pkgdir}" install
}

package_man-pages-mk() {
  pkgdesc="Macedonian man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/mk
  make DESTDIR="${pkgdir}" install
}

package_man-pages-nb() {
  pkgdesc="Norwegian bokmål man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/nb
  make DESTDIR="${pkgdir}" install
}

package_man-pages-nl() {
  pkgdesc="Dutch man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/nl
  make DESTDIR="${pkgdir}" install
}

package_man-pages-pl() {
  pkgdesc="Polish man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/pl
  make DESTDIR="${pkgdir}" install
}

package_man-pages-pt_br() {
  pkgdesc="Brazilian Portuguese man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/pt_BR
  make DESTDIR="${pkgdir}" install
}

package_man-pages-ro() {
  pkgdesc="Romanian man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/ro
  make DESTDIR="${pkgdir}" install
}

package_man-pages-ru() {
  pkgdesc="Russian man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/ru
  make DESTDIR="${pkgdir}" install
}

package_man-pages-sr() {
  pkgdesc="Serbian man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/sr
  make DESTDIR="${pkgdir}" install
}

package_man-pages-sv() {
  pkgdesc="Swedish man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/sv
  make DESTDIR="${pkgdir}" install
}

package_man-pages-uk() {
  pkgdesc="Ukrainian man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/uk
  make DESTDIR="${pkgdir}" install
}

package_man-pages-vi() {
  pkgdesc="Vietnamese man pages"
  depends=('man')

  cd manpages-l10n-$pkgver/po/vi
  make DESTDIR="${pkgdir}" install
}
